package com.ruoyi.cms.api;

import com.ruoyi.cms.domain.CmsDm;
import com.ruoyi.cms.service.ICmsDmService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 文档管理Controller
 *
 * @author ruoyi
 * @date 2020-06-06
 */
@Controller
@RequestMapping("/api/dm")
public class DmApiController extends BaseController {

    @Autowired
    private ICmsDmService cmsDmService;

    /**
     * 查询文档管理列表
     */
    @RequestMapping("/list")
    @ResponseBody
    public AjaxResult list(CmsDm cmsDm) {
        List<CmsDm> list = cmsDmService.selectCmsDmList(cmsDm);
        return AjaxResult.success("success", list);
    }

    /**
     * 查询文档管理列表 cid查询
     */
    @RequestMapping("/anlist")
    @ResponseBody
    public AjaxResult anlist(Long cid) {
        List<CmsDm> list = cmsDmService.getByCid(cid);
        return AjaxResult.success("success", list);
    }

}
